shah function